package stu.sup.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import stu.sup.entity.ClassTable;
import stu.sup.entity.ClassTableExample;

import java.util.Date;
import java.util.List;

public interface ClassTableMapper {
    int countByExample(ClassTableExample example);

    int deleteByExample(ClassTableExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(ClassTable record);

    int insertSelective(ClassTable record);

    List<ClassTable> selectByExample(ClassTableExample example);

    ClassTable selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") ClassTable record, @Param("example") ClassTableExample example);

    int updateByExample(@Param("record") ClassTable record, @Param("example") ClassTableExample example);

    int updateByPrimaryKeySelective(ClassTable record);

    int updateByPrimaryKey(ClassTable record);

    @Select("select product_id from class_table where product_brand=#{brand}")
    int selectbyBrand(String brand);
    //根据商品的产地进行查询
    @Select("select product_id from class_table where product_place=#{place}")
    int selectbyPlace(String place);
    //根据商品热销时间进行查询
    @Select("select product_id from class_table where product_time=#{time}")
    int selectByTime(Date time);
    //根据产品的重量进行查询
    @Select("select product_id from class_table where product_weight=#{weigt}")
    int selectByweigt(String weigt);
    //更具产品售货方式查询
    @Select("select product_id from class_table where product_saleway=#{way}")
    int selectByway(String way);
}